//
//  UIViewController+Empty.m
//  FNMenu
//
//  Created by 航汇聚科技 on 2018/9/27.
//  Copyright © 2018年 Yi Zhou. All rights reserved.
//

#import "UIViewController+Empty.h"
#import <LYEmptyView/LYEmptyViewHeader.h>
@implementation UIViewController (Empty)

- (LYEmptyView *)emptyViewLoadDataBlock:(void(^)(void))loadDataBlock {
    //初始化一个emptyView
    LYEmptyView *emptyView = [LYEmptyView emptyActionViewWithImageStr:@"nodata"
                                                             titleStr:@"无数据"
                                                            detailStr:@"请稍后再试!"
                                                          btnTitleStr:@"重新加载"
                                                        btnClickBlock:^{
                                                            if (loadDataBlock) {
                                                                loadDataBlock();
                                                            }
                                                        }];
    //元素竖直方向的间距
    emptyView.subViewMargin = 20.f;
    //标题颜色
    emptyView.titleLabTextColor = [UIColor colorWithRed:90/255. green:180/255. blue:160/255. alpha:1];
    //描述字体
    emptyView.detailLabFont = [UIFont systemFontOfSize:17];
    //按钮背景色
    emptyView.actionBtnBackGroundColor = [UIColor colorWithRed:90/255. green:180/255. blue:160/255. alpha:1];
    return emptyView;
}

@end
